//
//  ImageListCell.m
//  Movie
//
//  Created by tengyang on 15/7/22.
//  Copyright (c) 2015年 tengyang. All rights reserved.
//

#import "ImageListCell.h"
#import "UIImageView+WebCache.h"

@implementation ImageListCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {
        [self _createSubview];
    }
    return self;
}

- (void)_createSubview
{
    _imageView=[[UIImageView alloc]initWithFrame:self.contentView.bounds];
//设置cell显示图片的边的颜色和一系列的操作
    _imageView.layer.cornerRadius=10;
    _imageView.layer.borderWidth=1;
    _imageView.layer.borderColor=[UIColor whiteColor].CGColor;
    _imageView.layer.masksToBounds=YES;
    
    [self.contentView addSubview:_imageView];
}

- (void)setModal:(ImageListModal *)modal
{
    _modal=modal;
    [self setNeedsLayout];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [_imageView sd_setImageWithURL:[NSURL URLWithString:_modal.image]];
    
}
@end
